import { base } from '@/config'
import http from '@/utils/request'

// 场景二维码
const sceneCodeApi = {
  // 列表
  getSceneCodeList: params => {
    return http.get(`${base.sceneCode}/page`, { params })
  },
  // 新增
  addSceneCode: params => {
    return http.postJson(`${base.sceneCode}/add`, params)
  },
  // 编辑
  editSceneCode: params => {
    return http.postJson(`${base.sceneCode}/edit`, params)
  },
  // 隐藏显示
  isShow: params => {
    return http.postJson(`${base.sceneCode}/isShow`, params)
  },
  // 删除
  delete: id => {
    return http.post(`${base.sceneCode}/delete/${id}`)
  },
  // 详情
  detail: id => {
    return http.get(`${base.sceneCode}/info/${id}`)
  },
  // 详情列表
  detailList: params => {
    return http.get(`${base.sceneCode}/behavior/page`, params)
  },
  // 详情统计信息
  detailStatistics: id => {
    return http.get(`${base.sceneCode}/statistics/${id}`)
  },
  // 页面路径
  pageWay: params => {
    return http.get(`/user/backstage/appPages/select`, { params })
  }
}

export default sceneCodeApi
